import 'package:flutter/material.dart';
import '../../../../utils/base.dart';
import '../../../../widgets/tabs.dart';

class CommonListItem extends StatelessWidget {
  final String title;
  final String subtitle;
  final String rightText;
  final Color rightTextColor;
  const CommonListItem(
      {Key key, this.title, this.subtitle, this.rightText, this.rightTextColor})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    Widget _left = Column(
      mainAxisAlignment: MainAxisAlignment.center,
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Text(
          title,
          style: TextStyle(
            color: HexColor('333333'),
            fontSize: Design.px(38),
            decoration: TextDecoration.none,
            height: 1.5,
          ),
        ),
        Text(
          subtitle,
          style: TextStyle(
            color: HexColor('666666'),
            fontSize: Design.px(22),
            decoration: TextDecoration.none,
            height: 1.2,
          ),
        ),
      ],
    );

    Widget _right = Container(
      alignment: Alignment.center,
      child: Text(
        rightText,
        style: TextStyle(
          color: rightTextColor,
          decoration: TextDecoration.none,
          fontSize: Design.px(35),
        ),
      ),
    );

    return Container(
      padding: EdgeInsets.symmetric(
        vertical: Design.px(25),
        horizontal: Design.px(60),
      ),
      decoration: BoxDecoration(
        border: Border(
          bottom: BorderSide(
            width: Design.px(1),
            color: HexColor('cccccc'),
          ),
        ),
      ),
      child: Row(
        children: <Widget>[
          Expanded(
            child: _left,
          ),
          _right,
        ],
      ),
    );
  }
}
